<div ng-controller="userEditCtrl">
    <div class="page-header inner">
        <strong>用户设置</strong>
    </div>
    <form class="pure-form pure-form-aligned inner" novalidate>
        <div class="pure-control-group">
            <label>&nbsp;</label>
            <img class="img-small pure-help-inline" src="http://cdn.angularjs.cn/img/avatar.png" gen-src="{{user.avatar}}"/>
        </div>
        <div class="pure-control-group">
            <label>头像URL：</label>
            <input class="pure-input-1-2" type="url" name="头像" ng-model="user.avatar" gen-tooltip="validateTooltip"/>
        </div>
        <div class="pure-control-group">
            <label>用户名：</label>
            <input type="text" placeholder="name" name="用户名" ng-model="user.name" ui-validate="{username:checkName,minname:checkMin,maxname:checkMax}" gen-tooltip="validateTooltip" required/>
        </div>
        <div class="pure-control-group">
            <label>邮箱：</label>
            <input type="email" placeholder="email" name="邮箱" ng-model="user.email" gen-tooltip="validateTooltip" required/>
            <input type="button" class="pure-button pure-button-small success-bg"  title="修改邮箱后会自动发送一封验证邮件，通过验证后才保存修改" ng-click="verifyEmail()" value="验证邮箱" gen-tooltip>
        </div>
        <div class="pure-control-group">
            <label>用户性别：</label>
            <select ng-model="user.sex" ng-options="sex | match:'gender' for sex in sexArray">
            </select>
        </div>
        <div class="pure-control-group">
            <label>用户标签：</label>
            <textarea class="pure-input-1-2" name="用户标签" ng-model="user.tagsList" ng-list="/[,，、]/" ui-validate="{more:checkTag}" gen-tooltip="validateTooltip">
            </textarea>
        </div>
        <div class="pure-controls-group">
            <a class="pure-button pure-button-link" ng-repeat="tag in global.tagsList" ng-click="getTag(tag)"><small>{{tag.tag}}</small></a>
        </div>
        <div class="pure-control-group">
            <label>个人简介：</label>
            <textarea class="pure-input-1-2" name="个人简介" ng-model="user.desc" ui-validate="{maxlength:checkDesc}" gen-tooltip="validateTooltip">
            </textarea>
        </div>
        <div class="pure-control-group">
            <label>修改密码（不改留空）：</label>
            <input type="password" placeholder="password" name="密码" ng-model="user.passwd" ng-minlength="6" ng-maxlength="20" gen-tooltip="validateTooltip"/>
        </div>
        <div class="pure-control-group">
            <label>再次输入密码：</label>
            <input type="password" placeholder="password" name="重复密码" ng-model="user.passwd2" ui-validate="{repasswd:checkPwd}" ui-validate-watch="'user.passwd'" gen-tooltip="validateTooltip"/>
        </div>
        <div class="pure-controls">
            <button class="pure-button success-bg" type="submit" ng-click="submit()">保存</button>
            <button class="pure-button info-bg" ng-click="reset()">重置</button>
        </div>
    </form>
</div>
<div gen-modal="unSaveModal">确定要离开？未保存的数据将会丢失！</div>